<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<script type="text/javascript">
<!--
$(document).ready(
function(){
	typeSelectOption("SMS_TEMPLATE_TYPE","filter_LIKES_name","name","id","${param['filter_EQL_sysClass_id']}");
}
		);
function selectTemplate(id){
	var inputId = $("#inputId").val();
	var action = ctx+"/crm/smstemplate!ajaxTemplate.action";
	var template="";
	$.ajax({
		"url":action,
		"data":{"id":id},
		"async":false,
		"type":"POST",
		"dataType":"text",
		"success":function(txt){
			template = txt;
		}
		});
	$("#"+inputId).val(template);
	$.pdialog.closeCurrent();
}

//-->
</script>
<form id="pagerForm" method="post" action="${ctx }/crm/smstemplate!selectTemplate.action">
	<input type="hidden" name="status" value="${param.status}">
	<input type="hidden" name="keywords" value="${param.keywords}" />
	<input type="hidden" name="pageNum"  value="${page.pageNo}" />
	<input type="hidden" name="numPerPage" id="numPerPage" value="${page.pageSize}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
	<input type="hidden" name="selectedId" id="selectedId" value="" />
	
	<input type="hidden" name="page.pageNo" id="pageNo" value="${page.pageNo}"/>
	<input type="hidden" name="page.orderBy" id="orderBy" value="${page.orderBy}"/>
	<input type="hidden" name="page.order" id="order" value="${page.order}"/>
	<input type="hidden" name="page.pageSize" id="pageSize" value="${page.pageSize}"/>
	
	<input type="hidden" name="inputId" id="inputId" value="${param['inputId']}"/>
</form>

<div class="page">
	<div class="pageHeader">
		<form onsubmit="return dialogSearch(this);" action="${ctx }/crm/smstemplate!selectTemplate.action" method="post">
		<input type="hidden" name="inputId" id="inputId" value="${param['inputId']}"/>
		<div class="searchBar">
			<ul class="searchContent">
				<li style="width:40%">
					<label>模板名称：</label>
					<input type="text" name="filter_LIKES_name" value="${param['filter_LIKES_name']}"/>
				</li>
				<li style="width:40%">
					<label>模板分类：</label>
					<select id="filter_LIKES_name" name="filter_EQL_sysClass_id" >
						
					</select>
				</li>
			</ul>
			<div class="subBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit"> 检 索 </button></div></div></li>
				</ul>
			</div>
		</div>
		</form>
	</div>
	<div class="pageContent">
		<table class="table" layouth="142">
			<thead>
				<tr>
				<th>模板名称</th>
				<th>创建者</th>
				<th>更新时间</th>
				<th>模板分类</th>
				</tr>
			</thead>
			<tbody>
				<s:iterator value="page.result">
					<tr ondblclick="selectTemplate('${id}')">
						<td>${name}</td>
						<td>${user.name}</td>
						<td><s:date name="updatedate" format="yyyy-MM-dd HH:mm"></s:date></td>
						<td>${sysClass.name}</td>
					</tr>
		</s:iterator>	
			</tbody>
		</table>
		<div class="panelBar">
			<div class="pages">
				<span>显示</span>
				<select name="numPerPage" id="showNumPerPage" onchange="$('#pageSize').val($(this).val());navTabPageBreak({numPerPage:this.value})">
					<option value="14">14</option>
					<option value="20">20</option>
					<option value="50">50</option>
					<option value="100">100</option>
				</select>
				<span>条，共${page.totalCount}条</span>
			</div>
			
			<div class="pagination" targetType="navTab" totalCount="${page.totalCount}" numPerPage="${page.pageSize}" pageNumShown="10" currentPage="${page.pageNo}"></div>

		</div>
	</div>
</div>